<extend name="Base/base"/>

<block name="body">
	<div class="handler">
		<a href="{:U('add')}" class="btn btn-blue-o">新增</a>
	</div>
	<table class="list">
		<thead>
		<tr>
			<th>ID</th>
			<th>标题</th>
			<th>分类</th>
			<th class="col-width-10">视频？</th>
			<th class="col-width-10">推荐？</th>
			<th class="col-width-10">状态</th>
			<th class="col-width-15">操作</th>
		</tr>
		</thead>
		<tbody>
		<volist name="_list_" id="item">
			<tr>
				<td>{$item.id}</td>
				<td>{$item.title}</td>
				<td>{$item.category_name}</td>
				<td>
					<eq name="item.is_video" value="1">是</eq>
				</td>
				<td>
					<eq name="item.is_recommended" value="1">是</eq>
				</td>
				<td>
					<switch name="item.status">
						<case value="-1">删除</case>
						<case value="0">下架</case>
						<case value="1">上架</case>
					</switch>
				</td>
				<td>
					<a href="{:U('edit',array('id' => $item['id']))}">编辑</a>
					<switch name="item.status">
						<case value="-1"><a href="{:U('status',array('id' => $item['id'],'value' => 0))}" class="ajax-get confirm">重启</a></case>
						<case value="0"><a href="{:U('status',array('id' => $item['id'],'value' => 1))}" class="ajax-get confirm">上架</a></case>
						<case value="1"><a href="{:U('status',array('id' => $item['id'],'value' => 0))}" class="ajax-get confirm">下架</a></case>
					</switch>
					<neq name="item.status" value="-1"><a href="{:U('status',array('id' => $item['id'],'value' => -1))}" class="ajax-get confirm">删除</a></neq>
				</td>
			</tr>
		</volist>
		</tbody>
	</table>
	<div class="pagenavi">
		{$_page}
	</div>
</block>